import request from '/@/utils/request';

/**
 * 配置信息操作接口
 */
export function useConfigApi() {
	return {
		getConfigList: (params?: object) => {
			return request<any, AjaxResult>({
				url: '/config/List',
				method: 'get',
				params,
			});
		},
		configPageList: (data={}) => {
			return request<any, AjaxResult>({
				url: '/config/PageList',
				method: 'post',
				data,
			});
		},
		configGroupList: (params?: Object) => {
			return request<any, AjaxResult>({
				url: '/config/GroupList',
				method: 'get',
				params,
			});
		},
		addConfig: (data={}) => {
			return request<any, AjaxResult>({
				url: '/config/Add',
				method: 'post',
				data,
			});
		},
		editConfig: (data={}) => {
			return request<any, AjaxResult>({
				url: '/config/Update',
				method: 'post',
				data,
			});
		},
		deleteConfig: (data={}) => {
			return request<any, AjaxResult>({
				url: '/config/Delete',
				method: 'post',
				data,
			});
		},
		batchDeleteConfig: (data={}) => {
			return request<any, AjaxResult>({
				url: '/config/BatchDelete',
				method: 'post',
				data,
			});
		},
	};
}
